
import com.cec.mediatR.handler.IRequestHandler;
import com.cec.mediatR.service.IMediator;

import java.util.List;

public class DemoCService implements IDemoCService, IRequestHandler<RequestCService, List<People>> {
    private final IMediator mediator;

    public DemoCService(IMediator mediator) {
        this.mediator = mediator;
    }

    @Override
    public List<People> handle(RequestCService request) {

        return this.helloWithC(request.getPeoples());
    }

    @Override
    public String hello() {
        return this.mediator.send(new RequestBService());
    }

    @Override
    public List<People> helloWithC(List<People> people) {
        return people;
    }
}
